<template>
  <div>
    <div id="mainScroll">
      <!-- 按钮跳转 -->
      <div class="slide-box hairline-top hairline-bottom" v-if="slideshowList.length>0">
        <div class="slide-container" v-if="slideshowList.length == 1" @click="goSubject(slideshowList[0].subjectId)">
          <img :src="slideshowList[0].picUrl |thumbnail('_750_2048_100_0')" alt=""/>
        </div>
        <!--轮播图-->
        <div class="swiper-container" v-if="slideshowList.length>1">
          <div class="swiper-wrapper">
            <div class="swiper-slide" @click="goSubject(item.subjectId)" v-for="item in slideshowList">
              <img :src="item.picUrl |thumbnail('_750_2048_100_0')" alt=""/>
            </div>
          </div>
          <!-- 如果需要分页器 -->
          <div class="swiper-pagination"></div>

          <!-- 如果需要导航按钮 -->
          <!--<div class="swiper-button-prev"></div>-->
          <!--<div class="swiper-button-next"></div>-->

        </div>

      </div>
      <!--积分攻略链接-->
      <div class="point-detail-box hairline-top hairline-bottom">
        <div class="point-box">
          <span class="hairline point-icon">攻略</span>
        </div>
        <div class="title-link" @click="goIntroduce">
          门城因你更美好，快来了解随手拍攻略吧！
        </div>
      </div>
      <!-- 选项卡  最美北京  问题处理 -->
      <div class="tabs-box hairline-top">
        <div class="tabs-item" @click="changeTabs('prise')" :class="{'active': tabs.prise}">
          <span class="tabs-titlte">最美门城</span>
        </div>
        <div class="tabs-item" @click="changeTabs('warn')" :class="{'active': tabs.warn}">
          <span class="tabs-titlte">社会警示</span>
        </div>
        <div class="tabs-item" @click="changeTabs('problem')" :class="{'active': tabs.problem}">
          <span class="tabs-titlte">问题处理</span>
        </div>
      </div>
      <div class="waterfalls" id="wf">
        <!-- 无数据的时候 点击跳转发起随手拍 -->
        <div class="com-errorPage" v-if="photos && photos.length==0 && showData" @click="goPhoto">
          <p class="erroricon">
            <i class="icon icon-nodata"></i>
          </p>
          <p class="errormsg">暂无数据</p>
        </div>

        <!--  最美北京列表  start  -->
        <div v-if="tabs.prise">
          <div v-for="(item , index) in photos" class="photo-container" :class="{'load':item.load}" :key="index">
            <div class="img-box" @click="godetail(item.id,index)">
              <img :src="item.photo" @load="arrange(index)">
              <i class="img-num-box" v-text="item.photos"></i>
            </div>
            <div class="subinfo-box">
              <div class="title" @click="godetail(item.id,index)"><a class="subject-link"
                                                               @click.stop="goSubject(item.subjectId)">{{item.subjectName}}</a>
                <span class="detail-content-com">{{item.title| subStrings(item.subjectName)}}</span>
              </div>
              <div class="act-box">
              <span class="vote-box" :class="{'active': item.praised}">
                <i @click="praise(item)" :class="{'vote-icon': true}"></i>
                <i @click="praise(item)" class="vote-num">{{item.praiseCount | changeVote}}</i>
              </span>

                <span class="discuzz-box" @click="godetail(item.id,index)">
                <i class="discuzz"></i>
                <i class="discuzz-num">{{item.commentCount | changeDis}}</i>
              </span>
              </div>
            </div>
          </div>
        </div>
        <!-- 最美北京列表  end -->

        <!-- 社会警示  start-->
        <div v-if="tabs.warn">
          <div v-for="(item , index) in photos" class="photo-container" :class="{'load':item.load}" :key="index">
            <div class="img-box" @click="godetail(item.id,index)">
              <img :src="item.photo" @load="arrange(index)">
              <i class="img-num-box" v-text="item.photos"></i>
            </div>
            <div class="subinfo-box">
              <div class="title" @click="godetail(item.id,index)"><a class="subject-link"
                                                               @click.stop="goSubject(item.subjectId)">{{item.subjectName}}</a>
                <span class="detail-content-com">{{item.title| subStrings(item.subjectName)}}</span>
              </div>
              <div class="act-box">
              <span class="vote-box" :class="{'active': item.praised}">
                <i @click="praise(item)" :class="{'vote-icon': true}"></i>
                <i @click="praise(item)" class="vote-num">{{item.praiseCount | changeVote}}</i>
              </span>

                <span class="discuzz-box" @click="godetail(item.id,index)">
                <i class="discuzz"></i>
                <i class="discuzz-num">{{item.commentCount | changeDis}}</i>
              </span>
              </div>
            </div>
          </div>
        </div>
        <!-- 社会警示  end -->

        <!-- 问题处理列表  start-->
        <div v-if="tabs.problem">
          <div v-for="(item , index) in photos" class="photo-container" :class="{'load':item.load}" :key="index">
            <div class="img-box" @click="godetail(item.id,index, 'problem')">
              <img :src="item.photo" @load="arrange(index)">
              <i class="img-num-box" v-text="item.photos"></i>
            </div>
            <div class="subinfo-box">
              <div class="title" @click="godetail(item.id,index)"><a class="subject-link"
                                                               @click.stop="goSubject(item.subjectId)">{{item.subjectName}}</a>
                <span class="detail-content-com">{{item.title| subStrings(item.subjectName)}}</span>
              </div>
            </div>
          </div>
        </div>
        <!-- 投诉处理列表  end -->
        <!-- 加载更多 -->
        <div id="mainScrolldroploadDOM" class="droploadDOM"></div>
      </div>

    </div>
    <!--添加悬浮按钮-->
    <!--<div class="float-button">-->
    <!--<div class="action-box">-->
    <div class="pack-nav" :class="showActionFlag ">
      <div class="nav-icon" @click="showAction()">
        <i class="add-icon"></i>
        <p class="add-title">发布</p>
      </div>
      <div class="nav-action">
        <!--<div class="list-1">-->
        <div class="action-item" @click="goPhoto">
          <div class="icon-publish"></div>
          <div class="action-text">
            <div class="icon-title">发布</div>
          </div>
          <!--</div>-->
        </div>
        <!--<div class="list-2">-->
        <div class="action-item action-mypub" @click="goMyPhoto">
          <div class="icon-publish icon-my-pub">
            <i class="comment-dot" v-if="hasComment"></i>
          </div>
          <div class="action-text-mypub">
            <div class="icon-title">我的</div>
          </div>
        </div>
        <!--</div>-->
      </div>
    </div>
    <!--</div>-->
    <!--</div>-->
  </div>
</template>

<script>
  import  '../../../assets/css/swiper-3.4.2.min.css';
  import '../../../assets/js/swiper-3.4.2.jquery.min';
  import index from './list';
  export default index;
</script>


<style lang="less" scoped>
  .droploadDOM{ position: absolute ; width: 100% ; top: 0 ; }
  @keyframes scope0 {
    0% {
      width: 64px;
    }
    100% {
      width: 192px;
    }
  }

  @-webkit-keyframes scope0 /* Safari 和 Chrome */
  {
    0% {
      width: 64px;
    }
    100% {
      width: 192px;
    }
  }

  @keyframes scope1 {
    0% {
      width: 192px;
    }
    100% {
      width: 64px;
    }
  }

  @-webkit-keyframes scope1 /* Safari 和 Chrome */
  {
    0% {
      width: 192px;
    }
    100% {
      width: 64px;
    }
  }

  .pack-nav.active .nav-action {
    animation: scope0 .3s forwards;
    -webkit-animation: scope0 .3s forwards; /* Safari 和 Chrome */
  }

  .pack-nav.unactive .nav-action {
    animation: scope1 .25s ease-out forwards;
    -webkit-animation: scope1 .25s ease-out forwards; /* Safari 和 Chrome */
  }

  .pack-nav {
    position: fixed;
    bottom: 65px;
    height: 65px;
    right: 35px;
  }

  .nav-icon {
    position: absolute;
    right: 0;
    top: 0;
    z-index: 100;
    width: 64px;
    height: 64px;
    border-radius: 32px;
    background-color: #DF3031;
  }

  .nav-action {
    position: absolute;
    right: 0;
    top: 0;
    z-index: 99;
    width: 64px;
    height: 64px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 32px;
    overflow: hidden;
    -webkit-transition: all .3s;
    transition: all .3s;
    /*     -moz-transition: all 1s;
       -ms-transition: all 1s;
       -o-transition: all 1s;    */

  }
.paginationcurrent{
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 100%;
  background: #000;
  opacity: .5;
}
  .action-item {
    padding-left: 34px;
    position: absolute;
    top: 0px;
    left: 0px;
    height: 100%;
    width: 64px;
  }

  .action-mypub {
    left: 64px
  }

  /*轮播图*/
  .swiper-container {
    height: 100%;
  }

  .swiper-button-next, .swiper-button-prev {
    background-size: 14px 22px;
  }

  /*积分链接*/
  .point-detail-box {
    height: 40px;
    padding: 12px 0;
    overflow: hidden;
    background: #fff;
  }

  .title-link {
    font-size: 15px;
    color: #333333;
    float: left;
    line-height: 18px;
  }

  #wf {
    padding-bottom: 10px;
  }

  .load {
    position: relative;
    top: 90px;
  }

  #more {
    position: absolute;
    width: 100%;
    top: 100%;
    z-index: -1;
    /*display: none;*/
    /*background: red;*/
  }

  .droploadDOM {
    height: 30px;
    /*background: yellow;*/
  }

  /*专题*/
  a.subject-link {
    color: #12418E;
  }

  /*  操作框  */

  .slide-box {
    height: 190px;
    overflow: hidden;
    background: #fff;
  }

  .slide-box .slide-container {
    height: 100%;
  }

  .float-button {
    position: fixed;
    right: 35px;
    bottom: 65px;
    height: 65px;
  }

  .point-box {
    float: left;
    padding-left: 15px;
    padding-right: 2px;
  }

  .add-icon-box {
    width: 65px;
    height: 65px;
    background: red;
    border: 1px solid red;
    border-radius: 50%;
    position: relative;
    float: right;
  }

  .add-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url("../img/icon-add.png") no-repeat;
    background-size: contain;
    position: absolute;
    top: 11px;
    left: 22px;
  }

  .add-title {
    position: absolute;
    bottom: 8px;
    left: 18px;
    font-size: 13px;
    color: #fff;
  }

  .point-icon {
    background-size: cover;
    background: rgba(223, 48, 49, 0.10);
    border-radius: 2px;
    position: relative;
    border: none;
    font-size: 11px;
    color: #DF3031;
    line-height: 14px;
    padding: 2px;
    display: block;
  }

  .point-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    border: 1px solid #DF3031;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    width: 200%;
    height: 200%;
    -webkit-transform: scale(0.5);
    transform: scale(0.5);
    -webkit-transform-origin: left top;
    transform-origin: left top;
  }

  .icon-publish {
    width: 23px;
    height: 20px;
    background: url('../img/publish2.png') no-repeat;
    background-size: cover;
    float: left;
    position: relative;
    top: 13px
  }

  .icon-my-pub {
    background: url('../img/mypublish2.png') no-repeat;
    background-size: cover;
    margin-left: -15px;
    width: 20px;
    height: 17px;
    top: 15px;
  }

  .comment-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FF3B30;
    right: -4px;
    top: -4px;
  }

  .action-text {
    top: 38px;
    left: 30px;
    position: absolute;
  }

  .action-text-mypub {
    top: 38px;
    left: 17px;
    position: absolute;
  }

  .icon-title {
    font-size: 13px;
    color: #fff;
    letter-spacing: 0;
  }

  /*  tabs  */

  .tabs-box {
    margin-top: 10px;
    background: #fff;
    line-height: 44px;
    overflow: hidden;
  }

  .tabs-item {
    width: 33.3%;
    float: left;
    text-align: center;
  }

  .tabs-titlte {
    display: inline-block;
    line-height: 44px;
    font-size: 16px;
    color: #8E8E93;
    position: relative;
  }

  .tabs-item.active .tabs-titlte {
    color: #DF3031;
  }

  .tabs-item.active .tabs-titlte::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #DF3031;
  }

  /* 瀑布流 */
  .waterfalls {
    position: relative;
    width: 100%;
  }

  /* 图片容器 */
  .photo-container {
    position: absolute;
    width: 186px;
    opacity: 0;
    -webkit-transform: scale(0.9);
    transform: scale(0.9);
  }

  .photo-container.load {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
    transition: opacity .35s;
    -webkit-transition: opacity .35s;
    /*animation:showBox .25s .2s forwards;*/
    /*-webkit-animation:showBox .25s .2s forwards;*/
  }

  @keyframes showBox {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
      -webkit-transform: scale(1);
      transform: scale(1);
    }
  }

  @-webkit-keyframes showBox {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
      -webkit-transform: scale(1);
      transform: scale(1);
    }
  }

  /* 随手拍的logo */
  .logo-box {
    position: absolute;
    width: 167px;
    height: 70px;
    right: 15px;
    top: 0;
    background: url('../img/plogo.png') no-repeat center;
    background-size: cover;
  }

  .convphoto-title {
    margin-top: 14px;
    text-align: center;
    font-family: STHeitiSC-Medium;
    font-size: 17px;
    color: #FFFFFF;
    letter-spacing: -0.53px;
  }

  .convphoto-subtitle {
    font-family: STHeitiSC-Light;
    font-size: 15px;
    color: #FFFFFF;
    letter-spacing: -0.47px;
    line-height: 18px;
    margin-top: 5px;
    text-align: center;
  }

  .line {
    display: inline-block;
    width: 16px;
    height: 1px;
    opacity: 0.56;
    background: #FFFFFF;
    vertical-align: middle;
    margin: 0 3px;
  }

  .img-box {
    line-height: 0; // min-height: 100px;
    position: relative;
  }

  .img-box img {
    background: #fdfdfd;
  }

  .img-num-box {
    position: absolute;
    background: rgba(0, 0, 0, 0.40);
    border-radius: 2px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 14px;
    color: #FFFFFF;
    bottom: 10px;
    right: 10px;
  }

  .subinfo-box {

    font-size: 15px;
    color: #000000;
    line-height: 18px; // margin: 8px 0 14px 0;
    overflow: hidden;
    padding-bottom: 20px;
    background: #fff;
  }

  .title {
    font-size: 15px;
    color: #000000;
    line-height: 23px;
    margin-top: 5px;
    padding: 0 10px;
  }

  .act-box {
    line-height: 17px;
    margin-top: 7px;
    padding: 0 10px;
    overflow: hidden;
  }

  .vote-box {
    float: left;
    width: 84px;
  }

  .vote-box .vote-icon {
    background: url('../img/novote.png') no-repeat center;
    background-size: cover;
    display: inline-block;
    width: 17px;
    height: 17px;
    vertical-align: middle;
    margin-top: -3px;
  }

  .vote-box.active .vote-icon {
    background: url('../img/vote.png') no-repeat center;
    background-size: cover;
  }

  .vote-box .vote-num {
    font-size: 14px;
    color: #868686; // margin-left: 5px;
    vertical-align: middle;
  }

  .vote-box.active .vote-num {
    color: #DF3031;
  }

  .discuzz-box {
    float: left;
  }

  .discuzz {
    background: url('../img/discuzz.png') no-repeat center;
    background-size: cover;
    display: inline-block;
    width: 17px;
    height: 17px;
    vertical-align: middle; // margin-right: 5px;
  }

  .discuzz-num {
    font-size: 14px;
    color: #868686;
    vertical-align: middle;
  }

</style>
